#pragma once
#include <allegro5/allegro.h>
#include "MapDrawer.h"
#include "CharacterDrawer.h"
#include "TextDrawer.h"
#include "Input.h"
#include "Transition.h"
#include "Menu.h"

struct TitleScreenData
{
	int barY;
	int barH;
	float barB;
	float barM;

	int frameX;
	int frameY;
	int frameW;
	int frameH;
	float frameR;
	float frameB;
	float frameM;
	int frameTX;

	float arrowW;
	float arrowRM;
	float arrowP;

	ALLEGRO_COLOR colFg;
	ALLEGRO_COLOR colBg;
	ALLEGRO_COLOR colFgM;
	ALLEGRO_COLOR colBgM;

	bool lightBg;

	int gridW;
};

class Renderer
{
	public:
		Renderer();
		~Renderer();

		ALLEGRO_DISPLAY* GetDisplay() {return display;};
		MapDrawer* GetMapDrawer() {return mapDrawer;};

		void SetTransition(Transition* aTransition) {transition = aTransition;};
		void SetMap(Map* aMap);
		void SetMenu(Menu** aMenu) { menu = aMenu;};

		void ToggleFullscreen();
		void ResizeWindow(int aX, int aY);

		void Draw();

	private:
		ALLEGRO_DISPLAY* display;
		Transition* transition;
		MapDrawer* mapDrawer;
		Menu** menu;
		Color color;

		bool fullscreen;

		int screenW;
		int screenH;
		int windowW;
		int windowH;
		int actualW;
		int actualH;

		int tileSize;

		void PreTransition();
		void PostTransition();

		void DrawTitleScreen();
		void DrawFrame(MenuItem* aMenu, int aX, int aY);
		void DrawBalloon(Phrase* aPhrase, Character* aCharacter);

};

